public class Rectangle {
	private Point p1, p2;
	
	Rectangle(Point p1, Point p2) {
		this.p1 = p1;
		this.p2 = p2;
	}
	
	public Double getArea() {
		return Math.abs(xDifference() * yDifference());
	}
	
	public Double getDiagonal() {
		return Math.sqrt(Math.pow(xDifference(), 2) + Math.pow(yDifference(), 2));
	}
	
	private double xDifference()
	{
		return p2.x - p1.x;
	}

	private double yDifference()
	{
		return p2.y - p1.y;
	}
}
